/*
 * Class3A.h
 *
 *  Created on: 2015年7月16日
 *      Author: Administrator
 */
#include "Class3.h"
#ifndef BCCH_CLASS3A_H_
#define BCCH_CLASS3A_H_

//<Header: bitstring(5)> – 5 bits
//<Class Type 3 1bit>: “0”
//<Segment type 4bit>: “0000”
//struct ST3A_Header{
//	//header 由classType、segment Type组成
//	//1 bit
//	unsigned char classType:1;
//	//4bits
//	unsigned char segmentType:4;
//};
//<LAI> – 40 bits (for this gateway station)，参见GMR-1 04.008的11.5.1.3
struct LAI{
	unsigned char lai[5];
};

struct System {
	unsigned char SatelliteId:2;
	unsigned char SystemId:4;
};

/*<Latitude: bitstring(8)> – The latitude is in 2's complement represented in units of 0.1 degree.
Range is from –12,8 degrees to +12,7 degrees. Positive indicates North
<Longitude: bitstring(12)> – The longitude is represented in unit of 0.1 degree with range 0 to 360 degrees.
The degree spans in the westward direction with 0 degrees at Greenwich
<Radius: bitstring(16)> – The geocentric radius is represented in units of 0.005 km
with a range of –163.84 to +163.83 km, as the deviation from a default value of 42.162 km
 */
struct SatellitePosition{
	unsigned char Latitude;//8
	unsigned short Longitude:12;
	unsigned short Radius;
};
/**
 * – 23 bits
<Latitude: bitstring(11)> – The geocentric latitude is represented in units of 0.1
degree with range from –90 to +90 degrees latitude.Positive indicates North
<Longitude: bitstring(12)> – The geocentric longitude is represented in units of 0.1
degree with range from 0-360 degrees. Starting from 0 degrees at Greenwich, the degree
reading increases in the westward direction
 */
struct BEAM_CENTER_POS_main{
	unsigned short Latitude:11;
	unsigned short Longitude:12;
};
/*
<Misc. Information Class 3> – 6 bits
<SB_RESELECTION_TIMER: bitstring(6)> – In units of 4 minutes. Valid range: 0 - 252 minutes*/
struct MiscInfo{
	unsigned char SB_RESELECTION_TIMER:6;
};
class Class3A :public Class3{
public:
	Class3A();
	virtual ~Class3A();
	//5 bit
	//	ST3A_Header header;
	//40 bit
	LAI la;
	System system;
	SatellitePosition satPosition;
	BEAM_CENTER_POS_main beamCenterPos;
	MiscInfo miscInfo;
	//	<Spare: bitstring (4)> – 4 bits
	unsigned char spare:4;
};

#endif /* BCCH_CLASS3A_H_ */
